{template 'common/header'}
<link rel="stylesheet" href="../addons/kuyuan_fm/dist/web/common.css" />
<link rel="stylesheet" href="../addons/kuyuan_fm/dist/web/goods.css" />
<div id="louie" data-url="{php echo $this->createWebUrl('api')}">

    <!--S头部-->
    <div id="header">
        <h2><i class="iconfont icon-shangpin"></i>商品列表</h2>
        <a class="btn btn-info handel-btn" href="{php echo $this->createWebUrl('goods_edit')}">添加商品</a>
    </div>
    <!--E头部-->

    <!--S列表-->
    <table class="table table-hover">
        <tr><th>ID</th><th>商品名称</th><th>商品图片</th><th>价格</th><th>库存</th><th>状态</th><th>操作</th></tr>
        <tr v-for="(item,index) in list" :key="item.id">
            <td>{{item.id}}</td>
            <td>{{item.name}}</td>
            <td><img :src="item.cover" class="cover" /></td>
            <td>{{item.price}}</td>
            <td>{{item.inventory}}</td>
            <td>
                <button v-if="item.status == '1'" @click="clickStatus(index)" type="button" class="btn btn-info btn-xs">上架</button>
                <button v-if="item.status == '2'" @click="clickStatus(index)" type="button" class="btn btn-danger btn-xs">下架</button>
            </td>
            <td>
                <div class="btn-group btn-group-xs">
                    <button type="button" class="btn btn-info" @click="toEdit" :data-goods-id="item.id" data-url="{php echo $this->createWebUrl('goods_edit')}">修改</button>
                    <button type="button" class="btn btn-danger" @click="del(index)">删除</button>
                </div>
            </td>
        </tr>
        <tr class="empty" v-if="list.length <=0"><td td colspan="7">暂无数据</td></tr>
    </table>

    <pageing v-on:change-page="changePage" v-bind:total="total" v-bind:return-num="returnNum"></pageing>
    <!--E列表-->

    <!--提示框--><v-dialog style="z-index:99999999;"/>
</div>
<script src="../addons/kuyuan_fm/dist/web/common.js"></script>
<script src="../addons/kuyuan_fm/dist/web/goods.js"></script>
{template 'common/footer'}